<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

Route::allowCrossDomain();

Route::group('manage', function () {
    // 登录，获取route列表
    Route::post('login', 'login/index');
    Route::post('logout', 'login/logout');
    Route::get('info', 'login/user');

    // 用户组，用户管理
    Route::resource('rule', 'rule')->only(['index', 'save','read', 'update', 'delete']);
    Route::resource('group', 'group')->only(['index', 'create', 'save','read', 'update', 'delete']);
    Route::resource('user', 'user')->only(['index', 'create', 'save','read', 'update', 'delete']);

    // 用户个人信息管理
    Route::put('profile/update', 'profile/update');
    Route::patch('profile/modify', 'profile/modify');
    Route::post('profile/password', 'profile/changePassword');
    Route::post('profile/avatar', 'profile/avatar');
    Route::get('profile', 'profile/index');

    // 服务管理
    // 分类管理
    Route::resource('category','category')->only(['index', 'save','read', 'update', 'delete']);
    Route::resource('article','article')->only(['index', 'create', 'save','read', 'update', 'delete']);
    Route::patch('category/:id', 'category/modify');

    // 文件上传管理
    Route::post('upload/image', 'upload/image');
    Route::get('upload/index', 'upload/index');

    // 配置管理
    Route::resource('config', 'config')->only(['index', 'save','read', 'update', 'delete']);
    Route::resource('menu', 'menu')->only(['index', 'save','read', 'update', 'delete']);

    // 获取比赛
})->prefix('manage/');



